An instance of POCS can be loaded and run as a simulator, which will then allow you to play with various aspects of of POCS and allow all of the different parts of the system.
Any INFO level log messages will be displayed in the notebook but you can check $PANDIR/logs/panoptes.log for full debug output
In [1]:
# Load the POCS module
from pocs import POCS
In [2]:
# Create an instance of POCS that acts as a simulator
pocs = POCS(simulator=['all']) # Could be a list of: 'weather', 'camera', 'mount'
The pocs instance needs to be initialized, which will set up the cameras, mount, scheduler, etc.
In [3]:
pocs.initialize()
Out[3]:
During automated operations a script would simply call pocs.run() and the state machine would begin. However, the run() method is a blocking call so you can't interact with the system any more. Here we manually inspect some items.
In [4]:
# Check if we have a current observation:
print(pocs.observatory.current_observation)
In [5]:
# Get an observation by running the scheduler. Check the log file for details
new_obs = pocs.observatory.get_observation()
In [6]:
print(pocs.observatory.current_observation)
In [7]:
# Set a new high priority target. (NOTE this is a totally fake thing)
target = {
'name': 'Super Grav Wave Event',
'position': '22h57m47.0s +38d40m30.0s',
'priority': 999,
}
pocs.observatory.scheduler.add_observation(target)
In [8]:
# Get a new observation, which should be our new event
new_obs = pocs.observatory.get_observation()
In [9]:
pocs.observatory.scheduler.remove_observation('Super Grav Wave Event')
In [10]:
pocs.observatory.scheduler.observations
Out[10]: